<?php

/*
	Class: CareersLocations

	About: Author
		Rich Joslin

	About: License
		<http://communit.as/docs/license>

	About: See Also
		- <Cts_Db_Table_Abstract>
*/
class CareersLocations extends Cts_Db_Table_Abstract {

	/* Group: Instance Variables */

	/*
		Variable: $_name
	*/
	protected $_name = 'careers_locations';

	/*
		Variable: $_primary
	*/
	protected $_primary = 'id';

	/* Group: Instance Methods */

	/*
		Function: getOptionsArray

		Arguments:
			first_option - A string that gets placed as the first option with no value.

		Returns: array of rows or an empty array
	*/
	function getOptions($key_field, $value_field, $first_option = null) {
		$tmp_rows = $this->fetchAllArray();
		$rows = array();
		if (!is_null($first_option)) {
			$rows[''] = $first_option;
		}
		foreach ($tmp_rows as $row) {
			$rows[$row[$key_field]] = $row[$value_field];
		}
		return $rows;
	}

}
